package vip.liux.backend.domain.models.shop.address;

import org.springframework.data.repository.ListCrudRepository;
import org.springframework.data.repository.ListPagingAndSortingRepository;
import org.springframework.data.repository.NoRepositoryBean;

import java.util.List;

@NoRepositoryBean
public interface UserAddressRepository extends ListPagingAndSortingRepository<UserAddress, Long>, ListCrudRepository<UserAddress, Long> {

    List<UserAddress> findByUserId(Long userId);

    void updateNotDefaultAddress(Long addressId);

    boolean existsNByUserId(Long userId);
}